﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
using NHibernate.Linq;

namespace Perpus
{
    public class NhibernateHelper
    {
        string koneksi = MappingDatabase.koneksi;

        public ISessionFactory CreateSessionFactory()
        {
            return Fluently.Configure()
                .Database(MsSqlConfiguration.MsSql2008.ConnectionString(koneksi))
                .Mappings(m => m.FluentMappings.AddFromAssemblyOf<Pegawai>())
                .BuildSessionFactory();
        }
    }
}
